#

Instructor Notes#

Windows – Git Bash (Cygwin, PowerShell, Windows Subsystem for Linux (WSL))

Mac OSX – Terminal

Linux – Shell

Setup#

https://swcarpentry.github.io/shell-novice/setup.html

Download shell-lesson-data.zip and store the file on your Desktop

You can follow the lecture writeup, but do focus on the shell (terminal) :)

Introducing the Shell (10:10)#

GUI vs CLI

for a literature search, you have to copy the third line of one thousand text files in one thousand different directories and paste it into a single file.

BASH

$ cat /etc/shells

Change Shell:

$ chsh -s /bin/bash

prompt – $ (#, %) – shell is waiting for input/command

$ Command + Options + Argument
$ ls

senario:

Nelle, biologist

She has 1520 samples that she’s run through an assay machine to measure the relative abundance of 300 proteins.

She needs to run these 1520 files through an imaginary program called goostats.sh she inherited.

write a paper

use gui is mundane task

In order to achieve her task, Nelle needs to know how to:

  • navigate to a file/directory

  • create a file/directory

  • check the length of a file

  • chain commands together

  • retrieve a set of files

  • iterate over files

  • run a shell script containing her pipeline

Working With Files and Directories (11:30)#

$ mkdir
$ mkdir -p
$ ls -FR 

Pipes and Filters#

Loops#

Shell Scripts#

Finding Things#

Commands:

$ command + flag/option + argument(s)

Case Sensitive

print working directory

https://librarycarpentry.org/lc-shell/02-navigating-the-filesystem/index.html

Wildcard – * or ?

watch out for – rm